export const columns = context => {
  return [
    {
      // prop: 'linkName',
      label: '审批标题',
      minWidth: 100,
      render: (h, row) => {
        // processType 3日常，4特殊，5客情，6退款 9 包场 10 客诉 11实物 13文旅
        let dom = ''
        switch (row.processType) {
          case '3':
            dom = (
              <span>
                <el-tag type="success" size="mini" class="mr5">
                  日常
                </el-tag>
                {row.linkName}
              </span>
            )
            break
          case '4':
            dom = (
              <span>
                <el-tag type="warning" size="mini" class="mr5">
                  特殊
                </el-tag>
                {row.linkName}
              </span>
            )
            break
          case '5':
            dom = (
              <span>
                <el-tag type="success" size="mini" class="mr5">
                  客情
                </el-tag>
                {row.linkName}
              </span>
            )
            break
          case '6':
            dom = (
              <span>
                <el-tag type="danger" size="mini" class="mr5">
                  退款
                </el-tag>
                {row.linkName}
              </span>
            )
            break
          case '9':
            dom = (
              <span>
                <el-tag type="info" size="mini" class="mr5">
                  包场
                </el-tag>
                {row.linkName}
              </span>
            )
            break
          case '10':
            dom = (
              <span>
                <el-tag type="danger" size="mini" class="mr5">
                  客诉
                </el-tag>
                {row.linkName}
              </span>
            )
            break
          case '11':
            dom = (
              <span>
                <el-tag type="danger" size="mini" class="mr5">
                  公海
                </el-tag>
                {row.linkName}
              </span>
            )
            break
          case '12':
            dom = (
              <span>
                <el-tag type="danger" size="mini" class="mr5">
                  实物
                </el-tag>
                {row.linkName}
              </span>
            )
            break
          case '13':
            dom = (
              <span>
                <el-tag type="primary" size="mini" class="mr5">
                  文旅
                </el-tag>
                {row.linkName}
              </span>
            )
            break
          default:
            dom = <span>{row.linkName}</span>
            break
        }
        return dom
      }
    },
    {
      prop: 'processTypeName',
      label: '审批类型'
    },
    {
      prop: 'realName',
      label: '提单人'
    },
    {
      prop: 'departmentName',
      label: '归属部门',
      width: 200
    },
    {
      prop: 'createTime',
      label: '提单时间',
      width: 200
    },
    {
      label: '审批状态',
      width: 200,
      render: (h, row) => {
        let type = ''
        switch (row.status) {
          case '3':
            type = 'fc-success mr5 fs18'
            break
          case '1':
            type = 'fc-blue mr5 fs18'
            break
          case '2':
            type = 'fc-warn mr5 fs18'
            break
          case '4':
            type = 'fc-error mr5 fs18'
            break
          default:
            type = 'mr5 fs18'
            break
        }
        return (
          <span>
            <span class={type}>●</span>
            {row.statusName}
          </span>
        )
      }
    },
    {
      button: true,
      label: '操作',
      fixed: 'right',
      width: 150,
      render: (h, row) => {
        return [
          <a
            href="javascript:;"
            class="text-primary"
            onClick={() => {
              context.onDetail(row)
            }}
          >
            详情
          </a>
        ]
      }
    }
  ]
}

export const doneList = [
  {
    value: '1',
    name: '全部'
  },
  {
    value: '2',
    name: '通过'
  },
  {
    value: '3',
    name: '驳回'
  }
]
export const statusList = [
  {
    value: '1',
    name: '全部'
  },
  {
    value: '2',
    name: '审批中'
  },
  {
    value: '3',
    name: '通过'
  },
  {
    value: '4',
    name: '驳回'
  },
  {
    value: '5',
    name: '撤销'
  }
]
